<template>
  
    <van-nav-bar title="影院" left-text="苏州" @click-left="onClickLeft" fixed="true" />
    <van-dropdown-menu>
        <van-dropdown-item v-model="value0" :options="option0" />
        <van-dropdown-item v-model="value1" :options="option1" />
        <van-dropdown-item v-model="value2" :options="option2" />
    </van-dropdown-menu>
    <!-- <div class="titlewhite"></div> -->
    <div v-for="qwe in dataList" :key="qwe.filmId">
        <div class="cinemaList" @click="changeToCinemaDetail(qwe.cinemaId)">
            <div>
                <p class="cinemaname">{{qwe.name}}</p>
                <p class="cinemaaddr">{{qwe.address}}</p>
            </div>
            <div>

                <span class="filmprice">￥</span><span class="filmenum">438</span><span class="filmchn">起</span>
                <p class="cinemaaddrr">{{qwe.cinemaId}}km</p>
            </div>
        </div>
    </div>

    <!-- <div >
        <div class="cinemaList" @click="changeToCinemaDetail">
            <div>
                <p class="cinemaname">中影国线影城(坑梓店)</p>
                <p class="cinemaaddr">深圳市坪山区坑梓街道人民西路友田万家百货商场三楼</p>
            </div>
            <div>

                <span class="filmprice">￥</span><span class="filmenum">38</span><span class="filmchn">起</span>
                <p class="cinemaaddrr">1.3km</p>
            </div>
        </div>
    </div> -->


    <router-view></router-view>
</template>

<script>
// @ is an alias to /src
import { ref } from 'vue'
// 影院
import { getYingYuan } from "../api/product";
export default {
    data() {
        return {
          
                 dataList: {},
        };
    },
    // 影院
    created() {
        getYingYuan().then((res) => {
            console.log(res);

            this.dataList = res.data.data.cinemas;
        });


    },
    methods: {
        onClickLeft() {
            this.$router.push("/city");
        },
        changeToCinemaDetail(code) {
           // this.$router.push("/cinemadetail")

                 this.$router.push({
                name: "cinemadetail",
                query: {
                  cinemaId: code
                }
            });
        },




    },
    setup() {
        const value0 = ref(2);
        const value1 = ref(0);
        const value2 = ref('a');
        const option0 = [
            { text: '全城', value: 2 },
            { text: '吴中区', value: 3 },
            { text: '高新区', value: 4 },
            { text: '相城区', value: 5 },
            { text: '香港街', value: 6 },
        ];
        const option1 = [
            { text: 'APP订票', value: 0 },
            { text: '前台兑换', value: 1 },
        ];
        const option2 = [
            { text: '最近去过', value: 'a' },
            { text: '离我最近', value: 'b' },
        ];

        return {
            value0,
            value1,
            value2,
            option0,
            option1,
            option2,
        };
    },
}
</script>
